<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <title>propsData option</title>
    <script src="../assets/js/vue.js"></script>
</head>
<body>
    <h1>propsData option</h1>
    <hr/>
    <header></header>

    <script>
        var header_a = Vue.extend({
            template: `<p>{{message}} -- {{num}}</p>`,
            data: function(){
                return {
                    message: 'Hello I am header!'
                }
            },
            props: ['num']
        });

        //这里使用propsData将一个对象传递到扩展实例中
        new header_a({propsData: {num: 12}}).$mount('header');
    </script>

</body>
</html>